﻿using NetWing.BPM.Admin.weixin;
using NetWing.Common;
using NetWing.Common.Data.SqlServer;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NetWing.BPM.Admin.JydModleOrder
{
    public partial class outwarddelivery : System.Web.UI.Page
    {
        protected string keyid;
        protected DataTable dt;
        protected string myjhrq;
        protected string myws;
        protected string mynum;
        protected string myzzxm;
        protected int key;
        protected string open;
        protected string actual_quantity;
        protected string mysh;
        protected string receiving_time;
        protected string yspmc;
        protected void Page_Load(object sender, EventArgs e)
        {

            open = CookieHelper.GetCookie("openid");
            //当用户访问dingd.aspx 页面时,系统就会自动获得openid并返回当前页面
            
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(open))
                {
                    int dataTable = SqlEasy.ExecuteNonQuery("select * from Sys_Users where openid='" + open + "'");

                    if (dataTable == 0)
                    {
                        Response.Redirect(ConfigHelper.GetValue("website") + "/weixin/error.aspx?type=warn");
                    }
                }
                else
                {
                    string reurl = Request.Url.ToString();//获取当前url
                    CookieHelper.WriteCookie("returnurl", reurl);//把返回信息写入cookies
                    bool r = wxhelper.checkLogin();//wxhelper.checkLogin() 该函数会自动去获得用户openid 获得openid后需要返回当前入口页面 reurl 就是获得openid后的入口页面
                    string kk = "";
                }


                keyid =Request["yspmc"];
                
                dt = SqlEasy.ExecuteDataTable("select * from jydorderhoujiagong where yspmc= '" + keyid + "'");

                myjhrq = dt.Rows[0]["myjhrq"].ToString();
                myws = dt.Rows[0]["myws"].ToString();
                mynum = dt.Rows[0]["mynum"].ToString();
                myzzxm = dt.Rows[0]["myzzxm"].ToString();

                actual_quantity = dt.Rows[0]["actual_quantity"].ToString();
                mysh = dt.Rows[0]["mysh"].ToString();
                receiving_time = dt.Rows[0]["receiving_time"].ToString();
                yspmc = dt.Rows[0]["yspmc"].ToString();
            }
            


        }
    }
}